﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DanhSachSanPham.aspx.cs" Inherits="TemplateH4.DanhSachSanPham" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="css/mystyle.css" rel="stylesheet" type="text/css" />
    <style type="text/css">

        a:link{    margin-left: 0px;
}

        .style5
        {
            width: 151px;
        }

    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="col1">
        
    </div>
    
    <div id="col2">
    
        <br />
        <br />
                        <asp:GridView ID="grvSP" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" PageSize="2" Width="401px" 
            onpageindexchanged="grvSP_PageIndexChanged" 
            onpageindexchanging="grvSP_PageIndexChanging" 
            onrowdatabound="RowDataBound">
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <table style="width:100%;">
                                        <tr align="center">
                                            <td align="left" class="style5" colspan="2" width="300">&nbsp;<asp:HyperLink 
                                                    ID="HyperLink1" runat="server" Font-Size="X-Large" ForeColor="#000099" 
                                                    NavigateUrl='<%# "~/ChiTietSanPham.aspx?IdSP=" + Eval("MaSanPham") %>' 
                                                    Text='<%# Eval("TenSanPham") %>'></asp:HyperLink>
                                            </td>
                                        </tr>
                                            <tr>
                                                <td class="style4" align="center">
                                                    <asp:Image ID="imgSP" runat="server" Height="200px" Width="200px" />
                                                    <br />
                                                    <br />
                                                    <asp:Label ID="Label5" runat="server" Text="Giá:"></asp:Label>
                                                    <asp:Label ID="lbGia" runat="server" 
                                                        Text='<%# Eval("DonGia","{0:0,##0} VND") %>' Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="Red"></asp:Label>
                                                </td>
                                                <td align="left" valign="top" style="padding: 0px 0px 0px 10px;">
                                                    <br />
                                                    <asp:Label ID="Label1" runat="server" Text="Nhà SX:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:HyperLink ID="HyperLink2" runat="server" 
                                                        Text='<%# Eval("shop_nhasanxuat.TenNhaSanXuat") %>'></asp:HyperLink>
                                                    <br />
                                                    <asp:Label ID="Label2" runat="server" Text="Tình trạng:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:Label ID="lbTinhTrang" runat="server" 
                                                        Text='<%# Convert.ToInt32(Eval("SoLuongCon"))>0 ? "something" : "KhongCon" %>'></asp:Label>
                                                    <br />
                                                    <asp:Label ID="Label3" runat="server" Text="KM:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:Label ID="lbKM" runat="server"></asp:Label>
                                                    &nbsp;<br />
                                                    <asp:Label ID="Label4" runat="server" Text="Phái:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:Label ID="lbPhai" runat="server" 
                                                        Text='<%# Convert.ToBoolean(Eval("Phai"))==true?"Nam":"Nu" %>'></asp:Label>
                                                    <br />
                                                    <asp:Label ID="Label6" runat="server" Text="Mô Tả:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:Label ID="lbMoTa" runat="server" Text='<%# Eval("MoTa") %>'></asp:Label>
                                                </td>
                                            </tr>
                                           
                                        </table>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
    
        <asp:DetailsView ID="dtvSP" runat="server" 
            Height="50px" Width="125px" AllowPaging="True" 
            onitemcreated="dtvSP_ItemCreated" oniteminserted="dtvSP_ItemInserted">
            <Fields>
                <asp:TemplateField>
                    <ItemTemplate>
                        <table style="width:100%;">
                            <tr>
                                <td align="center" class="style4">
                                    <asp:Image ID="imgSP" runat="server" Height="178px" Width="193px" />
                                    <br />
                                    <asp:Label ID="Label5" runat="server" Text="Giá:"></asp:Label>
                                    <asp:Label ID="lbGia" runat="server" Font-Bold="True" Font-Size="Medium" 
                                        ForeColor="Red" Text='<%# Eval("DonGia","{0:0,##0} VND") %>'></asp:Label>
                                    <br />
                                </td>
                                
                            </tr>
                            
                            <tr>
                            <td align="left" valign="top" style="padding: 0px 0px 0px 10px;">
                                                    <asp:Label ID="Label1" runat="server" Text="Nhà SX:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:HyperLink ID="HyperLink2" runat="server" 
                                                        Text='<%# Eval("shop_nhasanxuat.TenNhaSanXuat") %>'></asp:HyperLink>
                                                    <br />
                                                    <asp:Label ID="Label2" runat="server" Text="Tình trạng:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:Label ID="lbTinhTrang" runat="server" 
                                                        Text='<%# Convert.ToInt32(Eval("SoLuongCon"))>0 ? "something" : "KhongCon" %>'></asp:Label>
                                                    <br />
                                                    <asp:Label ID="Label3" runat="server" Text="KM:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:Label ID="lbKM" runat="server"></asp:Label>
                                                    &nbsp;<br />
                                                    <asp:Label ID="Label4" runat="server" Text="Phái:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:Label ID="lbPhai" runat="server" 
                                                        Text='<%# Convert.ToBoolean(Eval("Phai"))==true?"Nam":"Nu" %>'></asp:Label>
                                                    <br />
                                                    <asp:Label ID="Label6" runat="server" Text="Mô Tả:" Font-Bold="True" 
                                                        Font-Size="Medium" ForeColor="#990000"></asp:Label>
                                                    <asp:Label ID="lbMoTa" runat="server" Text='<%# Eval("MoTa") %>'></asp:Label>
                                                </td>
                                
                            </tr>
                            
                        </table>
                    </ItemTemplate>
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="MaSanPham" 
            DataSourceID="SqlDataSource1" GroupItemCount="3">
            <EmptyItemTemplate>
                <td runat="server" />
                </EmptyItemTemplate>
                <ItemTemplate>

                </ItemTemplate>
                <AlternatingItemTemplate>
                    <td runat="server" style="">
                        MaSanPham:
                        <asp:Label ID="MaSanPhamLabel" runat="server" Text='<%# Eval("MaSanPham") %>' />
                        <br />
                        MaLoaiSanPham:
                        <asp:Label ID="MaLoaiSanPhamLabel" runat="server" 
                            Text='<%# Eval("MaLoaiSanPham") %>' />
                        <br />
                        MaNhaSanXuat:
                        <asp:Label ID="MaNhaSanXuatLabel" runat="server" 
                            Text='<%# Eval("MaNhaSanXuat") %>' />
                        <br />
                        TenSanPham:
                        <asp:Label ID="TenSanPhamLabel" runat="server" 
                            Text='<%# Eval("TenSanPham") %>' />
                        <br />
                        MoTa:
                        <asp:Label ID="MoTaLabel" runat="server" Text='<%# Eval("MoTa") %>' />
                        <br />
                        DonGia:
                        <asp:Label ID="DonGiaLabel" runat="server" Text='<%# Eval("DonGia") %>' />
                        <br />
                        SoLuongCon:
                        <asp:Label ID="SoLuongConLabel" runat="server" 
                            Text='<%# Eval("SoLuongCon") %>' />
                        <br />
                        NgayNhap:
                        <asp:Label ID="NgayNhapLabel" runat="server" Text='<%# Eval("NgayNhap") %>' />
                        <br />
                        SoLuongNhap:
                        <asp:Label ID="SoLuongNhapLabel" runat="server" 
                            Text='<%# Eval("SoLuongNhap") %>' />
                        <br />
                        HinhSanPham:
                        <asp:Label ID="HinhSanPhamLabel" runat="server" 
                            Text='<%# Eval("HinhSanPham") %>' />
                        <br />
                        KhuyenMai:
                        <asp:Label ID="KhuyenMaiLabel" runat="server" Text='<%# Eval("KhuyenMai") %>' />
                        <br />
                        <asp:CheckBox ID="PhaiCheckBox" runat="server" Checked='<%# Eval("Phai") %>' 
                            Enabled="false" Text="Phai" />
                        <br />
                    </td>
                </AlternatingItemTemplate>
                <EmptyDataTemplate>
                    <table runat="server" style="">
                        <tr>
                            <td>
                                No data was returned.</td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <td runat="server" style="">
                        MaLoaiSanPham:
                        <asp:TextBox ID="MaLoaiSanPhamTextBox" runat="server" 
                            Text='<%# Bind("MaLoaiSanPham") %>' />
                        <br />
                        MaNhaSanXuat:
                        <asp:TextBox ID="MaNhaSanXuatTextBox" runat="server" 
                            Text='<%# Bind("MaNhaSanXuat") %>' />
                        <br />
                        TenSanPham:
                        <asp:TextBox ID="TenSanPhamTextBox" runat="server" 
                            Text='<%# Bind("TenSanPham") %>' />
                        <br />
                        MoTa:
                        <asp:TextBox ID="MoTaTextBox" runat="server" Text='<%# Bind("MoTa") %>' />
                        <br />
                        DonGia:
                        <asp:TextBox ID="DonGiaTextBox" runat="server" Text='<%# Bind("DonGia") %>' />
                        <br />
                        SoLuongCon:
                        <asp:TextBox ID="SoLuongConTextBox" runat="server" 
                            Text='<%# Bind("SoLuongCon") %>' />
                        <br />
                        NgayNhap:
                        <asp:TextBox ID="NgayNhapTextBox" runat="server" 
                            Text='<%# Bind("NgayNhap") %>' />
                        <br />
                        SoLuongNhap:
                        <asp:TextBox ID="SoLuongNhapTextBox" runat="server" 
                            Text='<%# Bind("SoLuongNhap") %>' />
                        <br />
                        HinhSanPham:
                        <asp:TextBox ID="HinhSanPhamTextBox" runat="server" 
                            Text='<%# Bind("HinhSanPham") %>' />
                        <br />
                        KhuyenMai:
                        <asp:TextBox ID="KhuyenMaiTextBox" runat="server" 
                            Text='<%# Bind("KhuyenMai") %>' />
                        <br />
                        <asp:CheckBox ID="PhaiCheckBox" runat="server" Checked='<%# Bind("Phai") %>' 
                            Text="Phai" />
                        <br />
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <br />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                        <br />
                    </td>
                </InsertItemTemplate>
                <LayoutTemplate>
                    <table runat="server">
                        <tr runat="server">
                            <td runat="server">
                                <table ID="groupPlaceholderContainer" runat="server" border="0" style="">
                                    <tr ID="groupPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" style="">
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <EditItemTemplate>
                    <td runat="server" style="">
                        MaSanPham:
                        <asp:Label ID="MaSanPhamLabel1" runat="server" 
                            Text='<%# Eval("MaSanPham") %>' />
                        <br />
                        MaLoaiSanPham:
                        <asp:TextBox ID="MaLoaiSanPhamTextBox" runat="server" 
                            Text='<%# Bind("MaLoaiSanPham") %>' />
                        <br />
                        MaNhaSanXuat:
                        <asp:TextBox ID="MaNhaSanXuatTextBox" runat="server" 
                            Text='<%# Bind("MaNhaSanXuat") %>' />
                        <br />
                        TenSanPham:
                        <asp:TextBox ID="TenSanPhamTextBox" runat="server" 
                            Text='<%# Bind("TenSanPham") %>' />
                        <br />
                        MoTa:
                        <asp:TextBox ID="MoTaTextBox" runat="server" Text='<%# Bind("MoTa") %>' />
                        <br />
                        DonGia:
                        <asp:TextBox ID="DonGiaTextBox" runat="server" Text='<%# Bind("DonGia") %>' />
                        <br />
                        SoLuongCon:
                        <asp:TextBox ID="SoLuongConTextBox" runat="server" 
                            Text='<%# Bind("SoLuongCon") %>' />
                        <br />
                        NgayNhap:
                        <asp:TextBox ID="NgayNhapTextBox" runat="server" 
                            Text='<%# Bind("NgayNhap") %>' />
                        <br />
                        SoLuongNhap:
                        <asp:TextBox ID="SoLuongNhapTextBox" runat="server" 
                            Text='<%# Bind("SoLuongNhap") %>' />
                        <br />
                        HinhSanPham:
                        <asp:TextBox ID="HinhSanPhamTextBox" runat="server" 
                            Text='<%# Bind("HinhSanPham") %>' />
                        <br />
                        KhuyenMai:
                        <asp:TextBox ID="KhuyenMaiTextBox" runat="server" 
                            Text='<%# Bind("KhuyenMai") %>' />
                        <br />
                        <asp:CheckBox ID="PhaiCheckBox" runat="server" Checked='<%# Bind("Phai") %>' 
                            Text="Phai" />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <br />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                        <br />
                    </td>
                </EditItemTemplate>
                <GroupTemplate>
                    <tr ID="itemPlaceholderContainer" runat="server">
                        <td ID="itemPlaceholder" runat="server">
                        </td>
                    </tr>
                </GroupTemplate>
                <SelectedItemTemplate>
                    <td runat="server" style="">
                        MaSanPham:
                        <asp:Label ID="MaSanPhamLabel" runat="server" Text='<%# Eval("MaSanPham") %>' />
                        <br />
                        MaLoaiSanPham:
                        <asp:Label ID="MaLoaiSanPhamLabel" runat="server" 
                            Text='<%# Eval("MaLoaiSanPham") %>' />
                        <br />
                        MaNhaSanXuat:
                        <asp:Label ID="MaNhaSanXuatLabel" runat="server" 
                            Text='<%# Eval("MaNhaSanXuat") %>' />
                        <br />
                        TenSanPham:
                        <asp:Label ID="TenSanPhamLabel" runat="server" 
                            Text='<%# Eval("TenSanPham") %>' />
                        <br />
                        MoTa:
                        <asp:Label ID="MoTaLabel" runat="server" Text='<%# Eval("MoTa") %>' />
                        <br />
                        DonGia:
                        <asp:Label ID="DonGiaLabel" runat="server" Text='<%# Eval("DonGia") %>' />
                        <br />
                        SoLuongCon:
                        <asp:Label ID="SoLuongConLabel" runat="server" 
                            Text='<%# Eval("SoLuongCon") %>' />
                        <br />
                        NgayNhap:
                        <asp:Label ID="NgayNhapLabel" runat="server" Text='<%# Eval("NgayNhap") %>' />
                        <br />
                        SoLuongNhap:
                        <asp:Label ID="SoLuongNhapLabel" runat="server" 
                            Text='<%# Eval("SoLuongNhap") %>' />
                        <br />
                        HinhSanPham:
                        <asp:Label ID="HinhSanPhamLabel" runat="server" 
                            Text='<%# Eval("HinhSanPham") %>' />
                        <br />
                        KhuyenMai:
                        <asp:Label ID="KhuyenMaiLabel" runat="server" Text='<%# Eval("KhuyenMai") %>' />
                        <br />
                        <asp:CheckBox ID="PhaiCheckBox" runat="server" Checked='<%# Eval("Phai") %>' 
                            Enabled="false" Text="Phai" />
                        <br />
                    </td>
                </SelectedItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:EFashionH4ConnectionString %>" 
                SelectCommand="SELECT * FROM [shop_sanpham]"></asp:SqlDataSource>
        <br />
        <br />
    
    </div>
    
    <div id="col3">
    
    </div>
    
    </form>
    
</body>
</html>
